package service;

import Dao.StudentDao;
import bean.PageBean;
import bean.Student;
import factory.StudentDaoFactory;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    //自定义成员变量来记录学生数据访问对象
    private StudentDao studentDao;
    //自定义构造方法实现成员变量的初始化
    public StudentServiceImpl() {
        studentDao = StudentDaoFactory.getStudentDao ();
    }
    @Override
    public List<Student> studentShowService(PageBean pageBean) {
        return studentDao.studentShow (pageBean);
    }

    @Override
    public int studentAddService(Student student) {
        return studentDao.studentAdd (student);
    }

    @Override
    public int studentDeleteService(String[] ids) {
        return studentDao.studentDelete (ids);
    }

    @Override
    public int studentModifyService(Student student) {
        return studentDao.studentModify (student);
    }

    @Override
    public Student studentFindService(int id) {
        return studentDao.studentFind (id);
    }
}
